class Person {
  readonly name: string;
  age?: number;
  readonly friend?: Person;

  constructor(name: string, age?: number, friend?: Person) {
    this.name = name;
    this.age = age;
    this.friend = friend;
  }
}

const p = new Person("why", 18, new Person("kobe"));
console.log(p.name);
console.log(p.friend);

if (p.friend) {
  p.friend.age = 30;
}
console.log(p.friend);


export {};
